#pragma once
#include "tstring.h"

#include <boost/program_options.hpp>
using namespace boost::program_options;

#include <windows.h>

typedef enum {exp2Word, exp2File } ExportType_t;

class CProgramOptions
{
	options_description m_MainOptions;
	options_description m_HelpOptions;
	
	// workaround
	options_description m_WordOption;
	options_description m_FolderOption;
	// end workaround

	options_description m_ResizingOptions;
	options_description m_SplittingOptions;

	options_description m_OutputFormatOptions;

	variables_map m_VariablesMap;
	
	void PrintHelp();
	void SuggestToUseHelp();
	bool CheckForIncompatibleOptions();
	bool CheckForNecessaryOptions();
	void ShowIncompatibleSwitchesMsg(const char* FirstSwitch, const char* SecondSwitch);
	void ShowOptionMustBeGreaterThanZeroMsg(const char* OptionName);
	void ShowNeedNecessaryOptionMsg(const char* OptionName);
	void ShowInvalidCompressQuailtyMsg();
	
	bool m_OptionsWasStored;
public:
	CProgramOptions();
	bool ParseCommandLine(int argc, TCHAR* argv[]);
	
	ExportType_t GetExportType() const;
	bool NeedResize() const;
	bool NeedSplit() const;
	int GetCompressQuality() const;
	// Size, specifyed by command line
	void GetPieceSize(SIZE& PieceSize) const;
	void GetNewSize(SIZE& NewSize) const;

	void GetInputFileName(tstring& InputFileName) const;
	void GetOutputFileName(tstring& OutputFileName) const;
};